3.9 \(\int \frac{\csc ^2(x)}{a+a \sin (x)} \, dx\)

Optimal. Leaf size=26 \[ -\frac{2 \cot (x)}{a}+\frac{\tanh ^{-1}(\cos (x))}{a}+\frac{\cot (x)}{a \sin (x)+a} \]

[Out]

ArcTanh[Cos[x]]/a - (2*Cot[x])/a + Cot[x]/(a + a*Sin[x])

________________________________________________________________________________________

Rubi [A]  time = 0.0602264, antiderivative size = 26, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.385, Rules used = {2768, 2748, 3767, 8, 3770} \[ -\frac{2 \cot (x)}{a}+\frac{\tanh ^{-1}(\cos (x))}{a}+\frac{\cot (x)}{a \sin (x)+a} \]

Antiderivative was successfully verified.

[In]

Int[Csc[x]^2/(a + a*Sin[x]),x]

[Out]

ArcTanh[Cos[x]]/a - (2*Cot[x])/a + Cot[x]/(a + a*Sin[x])

Rule 2768

Int[((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_)/((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> -Simp[(b
^2*Cos[e + f*x]*(c + d*Sin[e + f*x])^(n + 1))/(a*f*(b*c - a*d)*(a + b*Sin[e + f*x])), x] + Dist[d/(a*(b*c - a*
d)), Int[(c + d*Sin[e + f*x])^n*(a*n - b*(n + 1)*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[
b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && LtQ[n, 0] && (IntegerQ[2*n] || EqQ[c, 0])

Rule 2748

Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[c, Int[(b*S
in[e + f*x])^m, x], x] + Dist[d/b, Int[(b*Sin[e + f*x])^(m + 1), x], x] /; FreeQ[{b, c, d, e, f, m}, x]

Rule 3767

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> -Dist[d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \frac{\csc ^2(x)}{a+a \sin (x)} \, dx &=\frac{\cot (x)}{a+a \sin (x)}-\frac{\int \csc ^2(x) (-2 a+a \sin (x)) \, dx}{a^2}\\ &=\frac{\cot (x)}{a+a \sin (x)}-\frac{\int \csc (x) \, dx}{a}+\frac{2 \int \csc ^2(x) \, dx}{a}\\ &=\frac{\tanh ^{-1}(\cos (x))}{a}+\frac{\cot (x)}{a+a \sin (x)}-\frac{2 \operatorname{Subst}(\int 1 \, dx,x,\cot (x))}{a}\\ &=\frac{\tanh ^{-1}(\cos (x))}{a}-\frac{2 \cot (x)}{a}+\frac{\cot (x)}{a+a \sin (x)}\\ \end{align*}

Mathematica [B]  time = 0.152978, size = 63, normalized size = 2.42 \[ \frac{\tan \left (\frac{x}{2}\right )-\cot \left (\frac{x}{2}\right )-2 \log \left (\sin \left (\frac{x}{2}\right )\right )+2 \log \left (\cos \left (\frac{x}{2}\right )\right )+\frac{4 \sin \left (\frac{x}{2}\right )}{\sin \left (\frac{x}{2}\right )+\cos \left (\frac{x}{2}\right )}}{2 a} \]

Antiderivative was successfully verified.

[In]

Integrate[Csc[x]^2/(a + a*Sin[x]),x]

[Out]

(-Cot[x/2] + 2*Log[Cos[x/2]] - 2*Log[Sin[x/2]] + (4*Sin[x/2])/(Cos[x/2] + Sin[x/2]) + Tan[x/2])/(2*a)

________________________________________________________________________________________

Maple [A]  time = 0.033, size = 45, normalized size = 1.7 \begin{align*}{\frac{1}{2\,a}\tan \left ({\frac{x}{2}} \right ) }-2\,{\frac{1}{a \left ( \tan \left ( x/2 \right ) +1 \right ) }}-{\frac{1}{2\,a} \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{-1}}-{\frac{1}{a}\ln \left ( \tan \left ({\frac{x}{2}} \right ) \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(x)^2/(a+a*sin(x)),x)

[Out]

1/2/a*tan(1/2*x)-2/a/(tan(1/2*x)+1)-1/2/a/tan(1/2*x)-1/a*ln(tan(1/2*x))

________________________________________________________________________________________

Maxima [B]  time = 1.67394, size = 92, normalized size = 3.54 \begin{align*} -\frac{\frac{5 \, \sin \left (x\right )}{\cos \left (x\right ) + 1} + 1}{2 \,{\left (\frac{a \sin \left (x\right )}{\cos \left (x\right ) + 1} + \frac{a \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}}\right )}} - \frac{\log \left (\frac{\sin \left (x\right )}{\cos \left (x\right ) + 1}\right )}{a} + \frac{\sin \left (x\right )}{2 \, a{\left (\cos \left (x\right ) + 1\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)^2/(a+a*sin(x)),x, algorithm="maxima")

[Out]

-1/2*(5*sin(x)/(cos(x) + 1) + 1)/(a*sin(x)/(cos(x) + 1) + a*sin(x)^2/(cos(x) + 1)^2) - log(sin(x)/(cos(x) + 1)
)/a + 1/2*sin(x)/(a*(cos(x) + 1))

________________________________________________________________________________________

Fricas [B]  time = 1.72996, size = 301, normalized size = 11.58 \begin{align*} \frac{4 \, \cos \left (x\right )^{2} +{\left (\cos \left (x\right )^{2} -{\left (\cos \left (x\right ) + 1\right )} \sin \left (x\right ) - 1\right )} \log \left (\frac{1}{2} \, \cos \left (x\right ) + \frac{1}{2}\right ) -{\left (\cos \left (x\right )^{2} -{\left (\cos \left (x\right ) + 1\right )} \sin \left (x\right ) - 1\right )} \log \left (-\frac{1}{2} \, \cos \left (x\right ) + \frac{1}{2}\right ) + 2 \,{\left (2 \, \cos \left (x\right ) + 1\right )} \sin \left (x\right ) + 2 \, \cos \left (x\right ) - 2}{2 \,{\left (a \cos \left (x\right )^{2} -{\left (a \cos \left (x\right ) + a\right )} \sin \left (x\right ) - a\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)^2/(a+a*sin(x)),x, algorithm="fricas")

[Out]

1/2*(4*cos(x)^2 + (cos(x)^2 - (cos(x) + 1)*sin(x) - 1)*log(1/2*cos(x) + 1/2) - (cos(x)^2 - (cos(x) + 1)*sin(x)
 - 1)*log(-1/2*cos(x) + 1/2) + 2*(2*cos(x) + 1)*sin(x) + 2*cos(x) - 2)/(a*cos(x)^2 - (a*cos(x) + a)*sin(x) - a
)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \frac{\int \frac{\csc ^{2}{\left (x \right )}}{\sin{\left (x \right )} + 1}\, dx}{a} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)**2/(a+a*sin(x)),x)

[Out]

Integral(csc(x)**2/(sin(x) + 1), x)/a

________________________________________________________________________________________

Giac [B]  time = 1.79242, size = 72, normalized size = 2.77 \begin{align*} -\frac{\log \left ({\left | \tan \left (\frac{1}{2} \, x\right ) \right |}\right )}{a} + \frac{\tan \left (\frac{1}{2} \, x\right )}{2 \, a} + \frac{\tan \left (\frac{1}{2} \, x\right )^{2} - 4 \, \tan \left (\frac{1}{2} \, x\right ) - 1}{2 \,{\left (\tan \left (\frac{1}{2} \, x\right )^{2} + \tan \left (\frac{1}{2} \, x\right )\right )} a} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)^2/(a+a*sin(x)),x, algorithm="giac")

[Out]

-log(abs(tan(1/2*x)))/a + 1/2*tan(1/2*x)/a + 1/2*(tan(1/2*x)^2 - 4*tan(1/2*x) - 1)/((tan(1/2*x)^2 + tan(1/2*x)
)*a)